<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
		<li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li><a ui-sref="main.user.userSupply.list">流量主用户</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">{{title}}
            <a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs" ui-sref="main.user.userSupply.list"><i class="text-md fa fa-times text-muted"></i></a>
        </div>
        
		<!--表单-->
		<div class="panel-body">
			<form class="form-horizontal" name="user_form">
				<div class="form-group">
                  	<div class="row">
                  		<label class="col-sm-2 control-label pull-right"></label>
                  		<label class="col-sm-1 control-label pull-right"><button class="btn btn-danger" ng-if="record.status==1" ng-click="refuseSupply(record.id,3)">审核失败</button></label>
						<label class="col-sm-1 control-label pull-right"><button class="btn btn-success" ng-if="record.status==1" ng-click="approve(record.id,2)">审核通过</button></label>
					</div>
                </div>
			    <div ng-if="record.userType!=2">
					<!--企业名称-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">企业名称:</label>
						<label class="control-label">{{record.companyName}}</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>
					<!--公司简称-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">公司简称:</label>
						<label class="control-label">{{record.companyNameAbbr}}</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>
					<!--流量主名称-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">流量主名称:</label>
						<label class="control-label">{{record.companyName}}</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>
					<!--主页链接-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">主页链接:</label>
						<label class="control-label">{{record.webSite | limitTo:50}}</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>

					<!--营业执照-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">营业执照:</label>
						<label class="control-label" id="businessLicenseArr">
                    	<span ng-repeat="item in businessLicenseArr track by $index">
                    		<a target='_blank' href='{{item}}'><img alt='' height='50' width='50' src='{{item}}'></a>
                    	</span>
						</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>

					<!--行业标签-->
					<div class="form-group">
						<label class="col-lg-2 col-sm-3 control-label">行业标签:</label>
						<label class="control-label">{{record.companyType}}</label>
					</div>
					<div class="line line-dashed b-b line-lg pull-in"></div>

				</div>

                    

                    
                <!--联系人-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">联系人:</label>
                    <label class="control-label">{{record.personName}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                
                <!--手机号码-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">手机号码:</label>
                    <label class="control-label">{{record.userMobile}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                


                
                <!--流量主联系人-->
                <!-- <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">流量主联系人:</label>
                    <label class="control-label">{{record.personName}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div> -->
                
                <!--联系方式-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">联系方式:</label>
                    <label class="control-label">{{record.mobile}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                

                

                
                <!--状态-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">状态:</label>
                    <label class="control-label">
                        <span ng-if="record.status==1" class="text-danger">待审核</span>
                        <span ng-if="record.status==2" class="text-success">启用中</span>
                        <span ng-if="record.status==3">审核失败</span>
                        <span ng-if="record.status==4">停用中</span>
                        <span ng-if="record.status==5">取消/删除</span>
                    </label>
                </div>
                <div class="line no-line b-b line-lg pull-in"></div>
                
                <div class="form-group" ng-show="platfroms.length>0">
                    <label class="col-lg-2 col-sm-3 control-label">下属渠道:</label>
                    <label class="col-lg-2 col-sm-1">
                    	<button class="ifc-btn btn-success" ng-click="approvePlatfrom('',2)" >批量通过</button>
                    	<button class="ifc-btn btn-danger"  ng-click="refuse('',3)" >批量失败</button>
                    </label>
                </div>
                <div ng-show="platfroms.length>0" class="form-group">
                	<label class="col-lg-2 col-sm-3 control-label"></label>
                	<div class="col-lg-10 col-sm-9">
                        <table class="table table-striped b-t b-light text-center">
                        	<thead>
	                            <tr>
	                            	<td width="7%"><input type="checkbox" ng-click="selectAll($event)"/>全选</td>
	                                <td width="5%">序号</td>
	                                <td>名称</td>
	                                <td>下载链接</td>
	                                <td>类型</td>
	                                <td>著作权</td>
	                                <td>状态</td>
	                                <td>操作</td>
	                            </tr>
                            </thead>
                            <tbody>
	                            <tr ng-repeat="item in platfroms">
	                            	<td align="center"><input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item.id)"/></td>
	                                <td align="center">{{$index+1}}</td>
	                                <td align="center" title="{{item.platformName}}">{{item.platformName | limitTo:10}}</td>
	                                <td align="center">{{item.downloadUrl}}</td>
	                                <td align="center">
	                        			<span ng-if="item.platformType==1">网站(PC&移动)</span>
	                        			<span ng-if="item.platformType==2">APP</span>
	                        		</td>
	                                <td align="center">
			                        	<span ng-if="item.industryQualification != null && item.industryQualification != ''">
			                        		<a ng-click="preview(item.industryQualification)" class="text-info">查看</a>
			                        	</span>
	                        		</td>
	                                <td align="center">
			                            <span ng-if="item.state==1" class="text-danger">待审核</span>
			                            <span ng-if="item.state==2" class="text-success">可用</span>
			                            <span ng-if="item.state==3">审核失败</span>
			                        </td>
	                                <td>
	                                    <button type="button" ng-show="item.state==1" ng-click="approvePlatfrom(item.id,2)" class="btn btn-sm btn-default m-l-xs">
	                                    <i class="fa fa-check m-r-xs text-sm"></i>确认</button>
	
	                                    <button type="button" ng-show="item.state==1" ng-click="refuse(item.id,3)" class="btn btn-sm btn-default m-l-xs">
	                                        <i class="fa fa-ban m-r-xs text-sm"></i>失败</button>
	                                </td>
	                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
			</form>
		</div>
		
		<div class="cover" ng-show="firstApply">
        	<div class="firstApplyWrap noselect">
          		<div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i></div>
          		<div class="title">
          			<span ng-repeat="item in industryQualifications track by $index">
          				<a target='_blank' href='{{item}}'><img alt='' height='100' width='100' src='{{item}}'></a>
          				<!-- <img alt="" height="100" width="100" ng-repeat="item in industryQualifications track by $index" src="{{item}}"> -->
          			</span>
          		</div>
        	</div>
   		</div>
    </div>
</div>

<form id="saveRefuse">
	<div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refusePlatfrom" role="dialog" aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="gridSystemModalLabel">平台审核</h4>
				</div>
				<div class="modal-body">
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">拒绝原因:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control" name="approveFailReason" maxlength="60" placeholder="请输入拒绝原因" ng-model="platfromInfo.approveFailReason">
						</div>
					</div>
					<p></p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" ng-click="saveRefuse()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</form>

<form id="saveUserSupply">
	<div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refuseUserSupply" role="dialog" aria-labelledby="gridSystemModalLabelSupply">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="gridSystemModalLabelSupply">流量主审核</h4>
				</div>
				<div class="modal-body">
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">拒绝原因:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control" name="approveReason" maxlength="60" placeholder="请输入拒绝原因" ng-model="userSupply.approveReason">
						</div>
					</div>
					<p></p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" ng-click="saveUserSupply()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</form>
<style>
	.cover {
	    position: fixed;
	    width: 100%;
	    height: 100%;
	    background: rgba(0,0,0,0.5);
	    z-index: 2000;
	    top: 0;
	    left: 0;
	    /* display: none; */
	}

  .firstApplyWrap{
    width: 550px;
    height:280px;
    background: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    -webkit-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    -o-transform: translate(-50%,-50%);
    -moz-transform: translate(-50%,-50%);
    border-radius: 5px;
    overflow: hidden;
  }
  .firstApplyWrap .title{
    font-size: 18px;
    color:#333;
    padding:18px 86px 0 130px;
    text-align: center;
    line-height: 2em;
  }
  .firstApplyWrap .closeBtn,.finishData .closeBtn{
    font-size: 30px;
    padding:5px 20px 0 0;
    border-radius: 50%;
    color: #ccc;
    float: right;
    cursor: pointer;
  }
  .finishData .closeBtn{
    position: absolute;
    top:10px;
    right:10px;
  }
  .firstApplyWrap .bkgIcon{
    position: absolute;
    left: 54px;
    top:87px;
    font-size: 50px;
    color:#FFB136;
  }
  .firstApplyWrap .applyBtnWrap{
    position: absolute;
    bottom: -2px;
    width: 100%;
  }
  .firstApplyWrap .applyBtn{
    width: 50%;
    height:70px;
    line-height: 70px;
    background: #FFB135;
    font-size: 20px;
    text-align: center;
    color:#fff;
    cursor: pointer;
    float:left;
  }
  .firstApplyWrap .applyBtn:last-child{
    background: #5796FC;
  }
</style>

